package com.lei.demo.simple.factory;

import com.lei.demo.simple.Cpu;
import com.lei.demo.simple.impl.AmdCpu;
import com.lei.demo.simple.impl.IntelCpu;

/**
 * CPU工厂类
 * @author chenhs
 * @time 2016年1月7日 上午11:10:59
 */
public class CpuFactory {
	
	public static Cpu createCpu(int type){
		Cpu cpu = null;
		if(type == 1){
			cpu = new IntelCpu(755);
		}else if(type == 2){
			cpu = new AmdCpu(938);
		}
		
		return cpu;
	}
}
